package com.situ.boot.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "bonus", schema = "brcc", catalog = "")
public class BonusEntity {
    private int id;
    private Short type;
    private Double money;
    private Timestamp bonusTime;
    private Integer uid;
    private Integer flag;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "type")
    public Short getType() {
        return type;
    }

    public void setType(Short type) {
        this.type = type;
    }

    @Basic
    @Column(name = "money")
    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    @Basic
    @Column(name = "bonus_time")
    public Timestamp getBonusTime() {
        return bonusTime;
    }

    public void setBonusTime(Timestamp bonusTime) {
        this.bonusTime = bonusTime;
    }

    @Basic
    @Column(name = "uid")
    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    @Basic
    @Column(name = "flag")
    public Integer getFlag() {
        return flag;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BonusEntity that = (BonusEntity) o;
        return id == that.id &&
                Objects.equals(type, that.type) &&
                Objects.equals(money, that.money) &&
                Objects.equals(bonusTime, that.bonusTime) &&
                Objects.equals(uid, that.uid) &&
                Objects.equals(flag, that.flag);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, type, money, bonusTime, uid, flag);
    }
}
